<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<h2 class="fs36 mb54 mt10" style="margin-left: 28px;"><?=$proData['proName']?></h2>
  <div class="timetips"><span style="font-weight: bold;">专营店信息</span><span>大区：<?=$storeData['region']?></span><span>小区：<?=$storeData['spsarea']?></span><span>城市：<?=$storeData['city']?></span><span>专营店名称：<?=$storeData['storeName']?></span></div>

<div class="timetips mt10"><span>所属双月：<?=$proData['timeUnitStr']?> </span><span>项目类型：<?=$proData['proTypeName']?> </span><span>截至提交时间：<?=date("Y-m-d H:i:s", $proData['endTime'])?></span></div>
<div class="partone mt10"></div>
<form name="add" id="add" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post">
<input type="hidden" name="subtype" id="subtype" value="0">
<input type="hidden" name="proId" id="proId" value="<?=$storeProData['proId']?>">
<?php foreach ($actList as $actK => $actV) {?>
<div class="panel panel-default feedbackpart">
  <!-- Default panel contents -->
  <div class="panel-heading"><h3><?=$actV['actTitle']?></h3></div>
  <div class="panel-body col-md-4 mb40">
    <p><?=$actV['actDesc']?></p>
  </div>
  <div class="panel-body partinner">
  <?php foreach ($actV['itemList'] as $itemK => $itemV) {
    $itemV['action'] = 'check';
  	printProActItem($itemV);
  } ?>
   </div>
   <div class="panel panel-default" style="margin-bottom: 0px;margin-right: 10px;border: 1px solid #000;padding: 10px;">
     <div class="panel-body">
        <div><b>审核</b></div>
        <div>
          <select class="form-control auditvalue" required style="width: 100px;" name="auditValue[<?=$actV['actId']?>][auditRs]" actId="<?=$actV['actId']?>">
            <option value="">请选择</option>
            <?php foreach ($proActAuditItems as $k => $v) {?>
              <?php if($k != 0){ ?>
              <option value="<?=$k?>" <?=$k==$actV['auditValue']['auditRs'] ? 'selected' : ''?>><?=$v?></option>
            <?php }}?>
          </select>
          <input class="form-control auditdes" type="text" style="<?php echo isset($actV['auditValue']['auditRs']) && $actV['auditValue']['auditRs'] ? '' : 'display: none;'?> width: 300px;" name="auditValue[<?=$actV['actId']?>][auditDes]" value="<?=$actV['auditValue']['auditDes']?>" id="auditdes<?=$actV['actId']?>">
        </div>
     </div>
   </div>
</div>
<?php } ?>
<div class="panel-body" style="margin-bottom: 10px;margin-right: 10px;border: 1px solid #000;padding: 10px;">
  <div><b>批量审核</b></div>
  <div>
    <select class="form-control" style="width: 100px;" name="auditBatch" id="auditBatch">
      <option value="">请选择</option>
      <?php foreach ($proActAuditItems as $k => $v) {?>
        <?php if($k > 0){ ?>
        <option value="<?=$k?>"><?=$v?></option>
      <?php }}?>
    </select>
    </div>
</div>
<div class="form-group text-center">
  <button type="submit" onclick="$('#subtype').val(0)" class="btn btn-primary">提交审核</button>
  <button type="submit" onclick="$('#subtype').val(1)" class="btn btn-primary" style="width: 170px;">提交并审核下一份反馈</button>
  <button type="button" onclick="window.location.href='<?=printUrl('AdminPro','storeProAuditNext', array('id'=>$storeProData['id']))?>'" class="btn btn-primary" style="width: 100px;">下一份反馈</button>
	<button type="button" onclick="window.location.href='<?=$breadcrumb[count($breadcrumb)-2]['url']?>'" class="btn btn-primary">返回</button>
</div>
</form>
<script type="text/javascript">
$(function(){
    initValidation();
});
$("#auditBatch").change(function(){
    $('.auditvalue').val($(this).val());
    if ($(this).val() != "") {
      $('.auditdes').show();
    }else{
      $('.auditdes').hide();
    }
});
$('.auditvalue').change(function(){
  if ($(this).val() != "") {
    $('#auditdes' + $(this).attr('actId')).show();
  }else{
    $('#auditdes'+$(this).attr('actId')).hide();
  }
});
  //初始化验证
function initValidation(){
  $('form[name="add"]').find("input,select,textarea").jqBootstrapValidation("destroy");
  $('form[name="add"]').find("input,select,textarea").not("[type=submit]").jqBootstrapValidation({
      preventSubmit:false,
      submitSuccess: function (form, event) {
           event.preventDefault();
           ajaxFormSubmit('add');
       },
       submitError: function (form, event, errors) {
         event.preventDefault();
         }
    });
}
</script>
<?php $this->load->view('common/foot');?>